package com.zaofan.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.Error;
import com.zaofan.dao.ErrorDao;

public class ErrorService {

	private ErrorDao errorDao = new ErrorDao();

	public void delete(Error error) {
		errorDao.del(error);
	}

	public void add(Error error) {
		errorDao.add(error);
	}

	public void update(Error error) {
		errorDao.update(error);
	}

	public List<Error> findAll(Map<String, Object> params) {
		List<Error> data = errorDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return errorDao.count(params);
	}

	public Error findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return errorDao.findOne(params);
	}

}
